package com.example.crm01.controller;

import com.example.crm01.entity.user;
import com.example.crm01.mapper.UserMapper;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {

    @Autowired
    UserMapper userMapper;

    @DeleteMapping("/delete/{id}")
    public Integer delete(@PathVariable("id") Integer id){
        return userMapper.deleteById(id);
    }

    @GetMapping("/edit/{id}")
    public user edit(@PathVariable("id") Integer id) {
        return userMapper.selectById(id);
    }

    }
